//
//  EAGLView.h
//  c_Render
//
//  Created by liao peterson on 10/29/09.
//  Copyright uestc 2009. All rights reserved.
//

#import "Macros.h"

@interface FrameBufferManager : NSObject{
    
@private
    /* The pixel dimensions of the backbuffer */
    GLint backingWidth;
    GLint backingHeight;
    
	CAEAGLLayer *eaglLayer;
    EAGLContext *context;
    
    /* OpenGL names for the renderbuffer and framebuffers used to render to this view */
    GLuint viewRenderbuffer, viewFramebuffer;
    
    /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */
    GLuint depthRenderbuffer;
}
@property (nonatomic, retain) EAGLContext *context;
- (BOOL) createMainFramebuffer;
- (void) destroyMainFramebuffer;
//- (void) drawView;
- (void) bindMainFrameBuffer;
- (void) renderMainFrameBuffer;
- (void) initEAGL:(CALayer*)layer;
@end
